<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        * {
            margin: 0;
            padding: 0;
        }

        #app {
            padding: 20px;
        }

        .checkGoods {
            width: 100%;
            height: 40px;
            display: flex;
            font-weight: bolder;
            justify-content: space-between;
        }

        .list {
            width: 100%;
            display: flex;
            font-weight: bolder;
            justify-content: space-between;
        }

        .list .text {
            display: flex;
        }

        .list .text img {
            width: 80px;
            height: 80px;
        }

        .list .txt {
            margin-left: 10px;
            display: flex;
            flex-direction: column;
            justify-content: space-between;
        }

        .list .txt .price {
            font-size: 20px;
            color: red;
        }

        .list .txt ._price {
            font-size: 14px;
            color: rgb(201, 198, 198);
            text-decoration: line-through;
        }

        .list .txt .goodsNum {
            display: flex;
            align-items: center;
        }

        .list .goodsNum span {
            padding: 0 15px;
        }

        button {
            width: 25px;
            height: 25px;
            font-size: 20px;
            color: white;
            border-radius: 50%;
            border: none;
            background-color: rgb(40, 186, 244);
            margin-top: 60px;
        }

        .tobal {
            width: 100%;
            height: 50px;
            background-color: rgb(71, 69, 69);
            position: fixed;
            bottom: 0;
            display: flex;
            font-size: 12px;
            padding-top: 8px;
            color: rgb(154, 153, 153);
            justify-content: space-around;
        }

        .tobal .tobalPrice {
            font-size: 20px;
            color: rgb(234, 228, 228);
        }

        .tobal ._tobalPrice {
            text-decoration: line-through;
            font-size: 14px;
            color: rgb(154, 153, 153);
        }

        .tobal input {
            width: 100px;
            height: 40px;
            color: white;
            font-size: 16px;
            border-radius: 8px;
            background-color: rgb(79, 193, 79);
        }
    </style>
</head>

<body>
    <div id="app">
        <div class="checkGoods">
            <div>已选商品</div>
            <div @click="clear">清空</div>
        </div>

        <div class="list" v-for="(item,index) in listArr">
            <div class="text">
                <img :src="item.pic" alt="">
                <div class="txt">
                    <p>{{item.name}}</p>
                    <p><span class="price">{{item.price}}</span><span class="_price">{{item._price}}</span></p>
                </div>
            </div>

            <div class="goodsNum">
                <button @click="reduce(item,index)">-</button>
                <span>{{item.num}}</span>
                <button @click="add(item,index)">+</button>
            </div>
        </div>

        <div class="tobal">
            <div class="goods-tobal-price">
                <p>
                    <span class="tobalPrice">￥528</span>
                    <span class="_tobalPrice">￥528</span>
                </p>
                <p>
                    另需配送费35元
                </p>

            </div>

            <input type="button" value="去结算">
        </div>

    </div>

    <script src="1.vue-2.5.21.js"></script>
    <script src="4.zuoye-购物车效果.js"></script>
</body>

</html>